package com.fjec.gateway.listener;

import com.alibaba.csp.sentinel.adapter.gateway.zuul.fallback.ZuulBlockFallbackManager;
import com.fjec.gateway.sentinel.MyBlockFallbackProvider;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;

public class AppStartedListener implements ApplicationListener<ApplicationStartedEvent> {

    public static AppStartedListener INSTNACE = new AppStartedListener();

    @Override
    public void onApplicationEvent(ApplicationStartedEvent event) {
        ZuulBlockFallbackManager.registerProvider(new MyBlockFallbackProvider());
    }
}
